<?php

/*
 *
 */

namespace Ruler;

use Ruler\Context;
use Ruler\Variable;
use Ruler\Rule;

foreach (glob("src/Ruler/*.php") as $filename)
{
    include_once $filename;
}
foreach (glob("src/Ruler/Operator/*.php") as $filename)
{
    include_once $filename;
}
 
$actualMerchantId = new Variable('actualMerchantId');
$context = new Context(array(
    'merchantId' => 555,
    'actualMerchantId' => function() {
        return 555;
    },
));
    
$rule = new Rule(
    new Operator\EqualTo(new Variable('merchantId'), $actualMerchantId),
    function() {
    
        echo 'MerchantId matches to given one, Here implement the rate according to mercahntid';
        
    }
);



    
//echo '<pre>';
//var_dump($rule);die;

$rule->execute($context); // "Yay!"







?>
